<script setup>
import { useImage } from '@vueuse/core'

const url = ''
const { isLoading, error } = useImage(
    {
      src: url,
    },
    {
      delay: 2000,
    }
)
</script>

<template>
  <div>
    <div v-if="isLoading" class="loading gradient"></div>
    <div v-else-if="error">加载失败</div>
    <img v-else :src="url" />
  </div>
</template>
